package com.itya.weatherback.Config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Configuration
@EnableAsync
public class AsyncConfig {
    @Bean
    public ExecutorService asyncExecutor() {
        return Executors.newFixedThreadPool(5); // 可配置为Bean
    }
}
